package result

type ResponseBean struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}
type NullJson struct {
}

func Success(data interface{}) *ResponseBean {
	if data != nil {
		return &ResponseBean{
			Code:    200,
			Message: "OK",
			Data:    data,
		}
	} else {
		return &ResponseBean{
			Code:    200,
			Message: "OK",
		}
	}
}

type ResponseErrBean struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

func Error(code int, msg string) *ResponseErrBean {
	return &ResponseErrBean{
		Code: code,
		Msg:  msg,
	}
}
